﻿<UserControl 
    x:Class="ibba.src.noriskbo.AppStartup"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:slc="clr-namespace:ibba.src.sl.componentes;assembly=ibba.src.sl.componentes"
    xmlns:vm="clr-namespace:ibba.src.noriskbo.ViewModels"
    mc:Ignorable="d"
    FontSize="12"
    d:DesignHeight="600" d:DesignWidth="600">

    <UserControl.Resources>
        <SolidColorBrush x:Key="CaptionColor" Color="#FF2B2B2B" />
        <SolidColorBrush x:Key="InformeColor" Color="#FF1F3C65" />

        <vm:AppStartupViewModel x:Key="viewModel"/>

        <slc:SwitchConverter x:Key="CorBordaRodapeConverter" 
                             Else="{x:Null}">
            <slc:SwitchCase When="0" Then="#FFEBAF24" />
            <slc:SwitchCase When="1" Then="#FFB44141" />
        </slc:SwitchConverter>
        <slc:SwitchConverter x:Key="CorFundoRodapeConverter" 
                             Else="{x:Null}">            
            <slc:SwitchCase When="0" Then="#FFF8ECC9" />
            <slc:SwitchCase When="1" Then="#FFFFEFEF" />
        </slc:SwitchConverter>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding Source={StaticResource viewModel}}">
        <Grid Margin="50,50,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            
            <Border CornerRadius="0,0,12,12" BorderThickness="2" Grid.Row="2"
                    Visibility="{Binding MensagemRodapeVisivel}" 
                    BorderBrush="{Binding TipoMensagemRodape, Converter={StaticResource CorBordaRodapeConverter}}" 
                    Background="{Binding TipoMensagemRodape, Converter={StaticResource CorFundoRodapeConverter}}"
                    Width="425" Padding="10,40,10,10" Margin="0,-30,0,0"                    
                    HorizontalAlignment="Left" VerticalAlignment="Top" >
                <Grid Background="{x:Null}">
                    <TextBlock Text="{Binding Path=MensagemRodape, FallbackValue=Nononono}" Foreground="{StaticResource CaptionColor}" FontSize="10.5" Margin="0,2,0,0"/>                    
                </Grid>
            </Border>

            <StackPanel Orientation="Vertical" Margin="0,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="-5,10,10,20">
                    <StackPanel Margin="0,0,20,0">
                        <TextBlock Text="NoRisk" FontSize="24" Margin="3,0,0,-20" />
                        <TextBlock Text="{Binding Path=TitleView}" FontSize="48" Margin="0,0,0,-16" />
                    </StackPanel>
                    <Image Source="{StaticResource LogoItauBBA}" VerticalAlignment="Bottom" Height="50" />
                </StackPanel>

                <Border Name="panelAmbiente" CornerRadius="15" BorderThickness="2" 
                    BorderBrush="Silver" Background="White" Width="425"
                    HorizontalAlignment="Left" VerticalAlignment="Top" Padding="10,20,10,10">
                    <Grid>
                        <StackPanel Name="contentPanelAmbiente" Orientation="Vertical" Width="400" >
                            <!--<TextBlock Text="Risco:" VerticalAlignment="Center" FontSize="13" Width="110" Foreground="#FF2B2B2B" />
                    <TextBlock Text="{Binding Operacao.ValorRiscoComprometido, Converter={StaticResource DecimalConverter}}" VerticalAlignment="Center" FontSize="13" Width="140" Foreground="#FF1F3C65" />-->
                            <StackPanel Orientation="Horizontal" Height="20">
                                <TextBlock Text="Diretório Virtual:" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{StaticResource CaptionColor}"/>
                                <TextBlock Text="{Binding Path=DiretorioVirtual}" Width="240" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{StaticResource InformeColor}" Margin="10,0,5,0"/>
                            </StackPanel>

                            <StackPanel Orientation="Horizontal" Height="20">
                                <TextBlock Text="Servidor Web:" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{StaticResource CaptionColor}"/>
                                <TextBlock Text="{Binding Path=ServidorWeb}" Width="240" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{StaticResource InformeColor}" Margin="10,0,5,0"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Height="20">
                                <TextBlock Text="Servidor MTS LB:" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{StaticResource CaptionColor}"/>
                                <TextBlock Text="{Binding Path=ServidorMTSLB}" Width="240" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{StaticResource InformeColor}" Margin="10,0,5,0"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Height="20">
                                <TextBlock Text="Servidor MTS Fixo:" Width="120" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{StaticResource CaptionColor}"/>
                                <TextBlock Text="{Binding Path=ServidorMTSFixo}" Width="240" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{StaticResource InformeColor}" Margin="10,0,5,0"/>
                            </StackPanel>

                            <StackPanel Orientation="Vertical" Visibility="{Binding PainelPerfilVisivel}" >
                                <StackPanel Orientation="Horizontal" Margin="0,5">
                                    <Border Style="{StaticResource LineGold}" Width="{Binding ElementName=contentPanelAmbiente, Path=Width}" />
                                </StackPanel>

                                <StackPanel Orientation="Horizontal" Height="20">
                                    <TextBlock Text="{Binding Path=MensagemPerfil}" Width="370" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{StaticResource InformeColor}" Margin="0,0,5,0"/>
                                    <slc:WaitLoading Name="waitPerfil" IsWait="{Binding PainelPerfilVisivel, Converter={StaticResource VisibilityToBooleanConverter}}" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" Margin="0,2" >
                                    <StackPanel Orientation="Vertical" Margin="40,0,0,0">
                                        <TextBlock Text="{Binding RetornoPerfil}" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{StaticResource CaptionColor}" Margin="0,0,5,0"/>                                        
                                    </StackPanel>
                                </StackPanel>
                            </StackPanel>

                            <StackPanel Orientation="Vertical" Visibility="{Binding PainelProcessamentoVisivel}">
                                <StackPanel Orientation="Horizontal" Margin="0,5">
                                    <Border Style="{StaticResource LineGold}" Width="{Binding ElementName=contentPanelAmbiente, Path=Width}" />
                                </StackPanel>

                                <StackPanel Orientation="Horizontal" Height="20">
                                    <TextBlock Text="{Binding Path=MensagemProcessamentoRisco}" Width="370" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{StaticResource InformeColor}" Margin="0,0,5,0"/>
                                    <slc:WaitLoading Name="waitProcessamento" IsWait="{Binding PainelProcessamentoVisivel, Converter={StaticResource VisibilityToBooleanConverter}}" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>
                        
                        <Grid Background="White" Margin="5,-28,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
                            <TextBlock Text="  [ Carregando Sistema ]  " FontSize="11" Foreground="#FF343232" FontWeight="Bold" />
                        </Grid>
                    </Grid>
                </Border>
                
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
